%
% Returns the distance matrix
%
function distances = getDistances(sites)

[m n] = size(sites);

distances = zeros(m, m);

for i=1:m
    s = sites(i, :);
    
    for j = 1:m
        
        if i == j 
            distances(i, j) = 0;
        else 
            t = sites(j, :);
            distances(i, j) = sqrt((s(1) - t(1))^2 + (s(2) - t(2))^2 + (s(3) - t(3))^2);
			distances(j, i) = distances(i, j);
        end
    end
end